package org.example.subsystem;

import org.example.Mediator;

public abstract class SubSystem {
    protected String name;
    protected Mediator mediator;

    SubSystem(String name){
        this.name = name;
    }

    public abstract void sendMessage(SubSystem to, String msg);
    public void receive(String msg){
        System.out.println(this.getName()+"收到了"+msg);
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Mediator getMediator() {
        return mediator;
    }

    public void setMediator(Mediator mediator) {
        this.mediator = mediator;
    }
}
